package com.vm.service.impl;

import java.util.List;

import com.vm.dao.phoneInfo.IPhoneInfoDao;
import com.vm.entity.PhoneInfo;
import com.vm.service.DriverInfoService;

public class DriverInfoServiceImpl implements DriverInfoService{
    private IPhoneInfoDao phoneInfoDao;
    
	
	public IPhoneInfoDao getPhoneInfoDao() {
		return phoneInfoDao;
	}


	public void setPhoneInfoDao(IPhoneInfoDao phoneInfoDao) {
		this.phoneInfoDao = phoneInfoDao;
	}


	@Override
	public List<PhoneInfo> getByPhoneBrand(String brand) {
		StringBuffer sb = new StringBuffer();
		sb.append(" from  PhoneInfo pi ");
		if(brand != null && !"".equals(brand)){
			sb.append(" where pi.piPp = ? ");
		}
		Object[] params = new Object[1];
		params[0] = brand;
		return phoneInfoDao.findByHql(sb.toString(), params);
	}

}
